<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	template="../Template/Template.xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">

	<ui:define name="title">
    Trang kết quả tìm kiếm nâng cao
  	</ui:define>

	<ui:define name="content">
		<div id="MainPanel" align="left">
			<div class="ContentPart">
				<div class="ContentPartContent">
					<p class="bold mediumSize">
						<c:if test="#{trangTimKiemNCBean.lstSanPham.size() == 0}">
							<h:outputText value="Không có kết quả phù hợp cho từ khóa " />
							<span class="mediumSize bold red italic">
								"#{trangTimKiemNCBean.tensanpham}"</span> và các điều kiện tương ứng.
						</c:if>

						<c:if test="#{trangTimKiemNCBean.lstSanPham.size() > 0}">
								Đã tìm thấy kết quả cho từ khóa <span
								class="mediumSize bold red italic">
								"#{trangTimKiemNCBean.tensanpham}"</span> và các điều kiện tương ứng.
						</c:if>
					</p>
				</div>
			</div>
			<div id="PhanTrang">
				Trang
				<c:forEach var="i" begin="0"
					end="#{trangTimKiemNCBean.XacDinhSoTrang() - 1}">				
	        &#160; &#160; &#160; &#160;
	        
	        <h:link value="#{i + 1}"
						outcome="#{trangTimKiemNCBean.TimKiem()}">
						<f:param name="thututrang" value="${i + 1}" />

					</h:link>

				</c:forEach>
			</div>

			<div class="boxContainer" align="center">
				<ui:repeat value="#{trangTimKiemNCBean.lstSanPham}" var="sanpham">

					<!-- <section> -->
					<div class="productBox">
						<div class="productName">
							<h2 align="center">
								<a href="#"> #{sanpham.tensanpham}</a>
							</h2>
						</div>

						<h:link outcome="TrangChiTietSanPham?faces-redirect=true">
							<f:param name="masanpham" value="#{sanpham.masanpham}"
								action="#{trangChiTietSanPhamBean.LaySanPhamTheoMaSP()}" />
							<img class="productImage imgNoBackgroundBorder" align="middle"
								src="../Images/Products/#{sanpham.hinhanh}" />
						</h:link>


						<p class="productIntro">#{sanpham.mota}</p>
						<div>

							<h:commandButton class="buttonLink button viewDetailButton"
								action="#{trangChiTietSanPhamBean.ShowSanPham(sanpham)}"
								value="Xem" />

							<h:outputText class="productPrice" value="#{sanpham.giaban}">
								<f:convertNumber groupingUsed="true" pattern="#0,000" />
							</h:outputText>
							VNĐ


							<h:commandLink process="@this" immediate="true"
								class="smallCartIcon"
								action="#{gioHangBean.ThemSanPham(sanpham.masanpham)}">
								<img class="smallCartIcon imgNoBackgroundBorder"
									src="../Images/green_cart.png" align="right" />
							</h:commandLink>

						</div>

					</div>
					<!-- </section> -->
				</ui:repeat>
			</div>
		</div>
	</ui:define>
</ui:composition>

